<?php
/* $Id$ */

require_once "ShockwaveFlashVideo.class.php";

class ShockwaveFlashVideoPlayer extends ShockwaveFlashVideo {

	private $content_movie_flv_fileName		=	null;

	function ShockwaveFlashVideoPlayer( $content_movie_flv_fileName ) {

		/* Superklasse aufrufen */
		$this->ShockwaveFlashVideo( );

		$this->content_movie_flv_fileName = $content_movie_flv_fileName;

	}

	function getContentFLVFileName_string() {
		return $this->content_movie_flv_fileName;
	}

	function layer_generated_GUI( ) {

//	function buildGUILayeredMovie ( $contentMovie_fileName, $width, $height, $background_rgb_array, $fps, $guiMovie_fileName ) {

		$gui_width	= 0;
		$gui_height	= 100;
		$gui_fps	= $fps;
		
		$script = <<<EOF

this.createTextField("mouse_txt", this.getNextHighestDepth(), 0, 0, 150, 66);
mouse_txt.html = true;
mouse_txt.multiline = true;
row1_str = "&nbsp;\t<b>_xmouse\t</b><b>_ymouse</b>";
this.onMouseMove = function() {

    mouse_txt.htmlText = "<textformat tabStops='[50,100]'>";
    mouse_txt.htmlText += row1_str;
    mouse_txt.htmlText += "<b>_level0</b>\t"+_xmouse+"\t"+_ymouse;
    mouse_txt.htmlText += "<b>my_mc</b>\t"+this._xmouse+"\t"+this._ymouse;
    mouse_txt.htmlText += "</textformat>";

fmt = new TextFormat();
fmt.color = 0xff0000;
mouse_txt.setTextFormat( fmt );


};

EOF;


		$movieMain = new SWFMovie();
		$movieMain->setBackground(0x0, 0x0, 0x0);
		$movieMain->setDimension($width + $gui_width, $height + $gui_height);
		$movieMain->setRate($gui_fps);


		$movieContent_item = $movieMain->add ( new SWFPrebuiltClip ( fopen($contentMovie_fileName, "rb") ) );
		$movieContent_item->moveTo(0,0);
		$movieContent_item->setName("movieContent");


/*getURL('http://www.tupperworx.de.heimnetz/project/mingtest-video.php', '_top');*/

		$text_item = swf_set_new_text( $movieMain, "text1", 0, 400, "FreeSerif.fdb", 40, array(0xff, 0xff, 0xff),
			"Toll"
		);

		$text1_item = swf_set_new_text( $movieMain, "text2", 0, 400, "FreeSerif.fdb", 20, array(0xff, 0xff, 0xff),
			"Mein Pippimann juckt"
		);


		
		$gui_status_action = $movieMain->add( new SWFAction( $script ) );

		$button1_item_id = swf_make_easyButton( 
				$movieMain,
				"button1",
				10,
				490,
				"movieContent.newStream.seek(0);" 
		);

		$button2_item_id = swf_make_easyButton( 
				$movieMain,
				"button2",
				200,
				490,
				"movieContent.newStream.pause();" 
		);

		//$picture_item = swf_set_new_picture( $movieMain, "testpicture", 150, 150, "data/images/tupperworx_logo.dbl" );

		swf_set_new_picture_as( $movieMain, "tupperworx_logo.dbl", 150, 150 );

		for ($i = 0; $i < 600; $i++) {
        		$text_item->moveTo($i, 490);
        		$movieMain->nextFrame();
		}

		$movieMain->save($guiMovie_fileName);

		return array ( $gui_width+$width, $gui_height+$height );

	}


	function addLayer() {


	}




}



?>
